<template>
	<view class="pages">
		<view class="content">
			<title>活动微信群二维码</title><br />
			<p>可进入微信活动群，及时接收活动信息</p>
			<text>若扫码未进入，请联系城市管理员</text>
			<view class="ewmimg">
				<title>{{model.crowd_code?model.crowd_code_name?('群聊'+ model.crowd_code_name):'':'未上传'}}</title>
				<image :src="rq.imgUrl(model.crowd_code)" mode="scaleToFill" /><br /><text
					v-if="model.crowd_code_time">该二维码7天内 ({{model.crowd_code_time}}前) 有效，重新进入将更新</text>
			</view>
		</view>
		<view class="btn" @click="chat(model.daili_user_id)">联系城市管理员</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				model: {}
			}
		},
		onLoad(e) {
			this.rq.getData('Activity/getQrcode', {
				id: e.id
			}).then(res => {
				this.model = res.data
			})
		},
		methods: {
			chat(id) {
				uni.navigateTo({
					url: '/subpages/message/chat?id=' + id
				})
			}
		}
	};
</script>

<style lang="scss" scoped>
	.pages {
		background-color: #f6f6f6;

		.content {
			text-align: center;
			margin: 50rpx auto;
			width: 80%;

			title {
				font-size: 30rpx;
			}

			p {
				color: #999999;
				font-size: 28rpx;
				padding: 15rpx 0;
			}

			text {
				color: #ff7681;
				font-size: 26rpx;
			}

			.ewmimg {
				width: 550rpx;
				height: 600rpx;
				background: #ffffff;
				border-radius: 25rpx;
				margin: 30rpx 0;
				padding: 20rpx;
				display: flex;
				flex-direction: column;
				align-items: center;
				justify-content: space-between;

				image {
					width: 450rpx;
					height: 420rpx;
					margin:20rpx 0;
				}

				text {
					color: #999999;
					font-size: 24rpx;
				}
			}
		}

		.btn {
			background: #ffffff;
			padding: 30rpx 0rpx;
			width: 90%;
			border-radius: 25rpx;
			text-align: center;
			position: fixed;
			bottom: 20rpx;
			left: 5%;
		}
	}
</style>